			<?php $do_action 	= $this->session->userdata('menu_do_action_success'); 
				  $change_status= $this->session->userdata('menu_change_status_success');
				  $change_order	= $this->session->userdata('menu_change_order_success');			
				if(isset($do_action) && $do_action == "yes"){?>
				<div id="tonySuccess" class="success"><?php echo $this->lang->line('action_mess');?></div>
			<?php }elseif (isset($change_status) && $change_status == "yes") {?>
				<div id="alertMessage" class="success"><?php echo "Status has been changed successfully !";?></div>
			<?php }elseif (isset($change_order) && $change_order == "yes"){?>
				<div id="alertMessage" class="success"><?php echo "Order has been changed successfully !";?></div>
			<?php }?>
			<div id="content">
                <div class="inner">
					  <div class="topcolumn">
							<div class="logo"></div>
                            <ul  id="shortcut">
                                <li> <a href="#" title="Back To home"> <img src="<?php echo base_url();?>public/admin/img/icon/shortcut/home.png" alt="home"/><strong>Home</strong> </a> </li>
                                <li> <a href="#" title="Website Graph"> <img src="<?php echo base_url();?>public/admin/img/icon/shortcut/graph.png" alt="graph"/><strong>Graph</strong> </a> </li>
                                <li> <a href="#" title="Setting" > <img src="<?php echo base_url();?>public/admin/img/icon/shortcut/setting.png" alt="setting" /><strong>Setting</strong></a> </li> 
                                <li> <a href="#" title="Messages"> <img src="<?php echo base_url();?>public/admin/img/icon/shortcut/mail.png" alt="messages" /><strong>Message</strong></a><div class="notification" >10</div></li>
                            </ul>
					  </div>
	                  <div class="clear"></div>

	                  <div class="onecolumn" >
	                  	  <div class="header"><span ><span class="ico  gray arrow_bidirectional"></span><?php echo $this->lang->line('menu_title');?></span> </div><!-- End header -->	
	                  	  <div class="clear"></div>
		                  <div class="content" >
		                      <div id="uploadTab">
		                      <form action="<?php echo admin_url();?>/menu" method="post" id="list_menu_form">
			                      <div class="toppage" >
			                      	  <span class="left">
							        	<select style="width: 130px;" id="action">
							            	<option value=""><?php echo $this->lang->line('choose_action'); ?></option>                               
							                <option value="active"><?php echo $this->lang->line('active'); ?></option>
							                <option value="suspend"><?php echo $this->lang->line('suspend'); ?></option>
							                
							            </select>
							            <input onclick="submit_action()" value="<?php echo $this->lang->line('apply'); ?>" class="btn" type="button" />
							            <?php if(count($cate_info)>0){?>
							            <select style="width: 130px;" id="action" name="item_parent">
							            	<option value="-1" <?php echo ($current_filter_parent==-1)?'selected': '';?>><?php echo $this->lang->line('list_all'); ?></option>
					                		<!--  <option value="0" <?php echo ($current_filter_parent==0)?'selected':'';?>><?php echo $this->lang->line('parent'); ?></option>-->
					                		<?php foreach($cate_info as $leaf) {?>
											<option value="<?php echo $leaf->id;?>" <?php echo ($current_filter_parent==$leaf->id)?'selected':'';?>>
												<?php
													for($i=0; $i<$leaf->level-1; $i++) {
														echo '&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp';
													} 
													if($leaf->level>0) echo '&nbsp&nbsp&nbsp&nbsp|__ ';
													echo $leaf->name;
												?>
											</option>
											<?php }?>
							            </select>
							            <?php }?>
			                            <input type="submit" name="" value="<?php echo $this->lang->line('filter')." by parent"; ?>" class="btn" />
							          </span>	
			                          
			                      </div>
			                      <div class="tab_container" >
			                          <div id="tab" class="tab_content"> 
			                            <div class="load_page">
			                              <ul class="uibutton-group">
			                                    <li><a class="uibutton icon add " href="<?php echo admin_url('add-new-menu'); ?>"  title="Add Menu">Add Menu</a></li>
			                              </ul>
			                              <div class="topart">
			                              	
				                              	<span class="left">
										    		<?php 
										    			$total_amount	=	$this->menu_model->count_all();
										    			$active			=	$this->menu_model->count_active();
										    		?>
										    		<font class="number">(<?php echo $total_amount;?>)</font>
										    		<a href="javascript:void(0);" onclick="sendData('all')"><?php echo $this->lang->line('all'); ?></a>
										    		<font class="line">|</font><font class="number">(<?php echo $active;?>)</font>
										    	    <a href="javascript:void(0);" onclick="sendData('active')"><font color="#0b9901"><?php echo $this->lang->line('active'); ?></font></a>
										    	    <font class="line">|</font><font class="number">(<?php echo $total_amount - $active;?>)</font> 
										    	    <a href="javascript:;" onclick="sendData('pending')"><font color="#c60001"><?php echo $this->lang->line('pending'); ?></font></a>
										        </span>
										        <span class="right1">
										        <!-- 
									        	<select style="width:50px;" name="perpage" id="perpage" onchange="changeItemNumber()">
									            	<option value="6" <?php echo ($current_perpage==6)?'selected':'';?>>6</option>
									                <option value="12" <?php echo ($current_perpage==12)?'selected':'';?>>12</option>
									                <option value="24" <?php echo ($current_perpage==24)?'selected':'';?>>24</option>
									                <option value="all" <?php echo ($current_perpage=='all')?'selected':'';?>><?php echo $this->lang->line('all'); ?></option>
									            </select>
									             -->
									        	</span>
								        	</form>
			                              </div>
			                              <form action="<?php echo admin_url('menu/do-action');?>" method="post" id="menu_form">
											  <div class="tableName toolbar">
												<table class="display data_table2" >
													<thead>
														<tr>
															<th width="5%" ><input type="checkbox" class="check_all" onclick="check_all('.check_all')"/></th>
						                                    <th width="25%" align="left">Name</th>
						                                    <th width="30%" align="left">Url</th>
						                                    <th width="25%" align="left">Parrent</th>
						                                    <th width="8%" align="left">Order</th>
						                                    <th width="8%" align="left">Status</th>
														</tr>
													</thead>
													<?php if(isset($menu_list[0])){?>
		        											<?php foreach ($menu_list as $k => $v){
		        												$check_is_child = $this->menu_model->check_is_child($v->id);
		        											?>
													<tr>
					                                    <td >
					                                    <?php if($v->parent_id == 0){?>
					                                    	<input name="id[]" value="<?php echo $v->id;?>" type="checkbox" />
					                                    <?php }?>
					                                    </td>
					                                    <td align="left" >
					                                    	<div class="column"  onmouseover="Hovercat('<?php echo $v->id;?>')" onmouseout="Outcat('<?php echo $v->id;?>')">
					                                    		<a href="javascript:;" style="font-weight: bold; " class="art cate_name_<?php echo $v->id;?>">
					                                    			<?php 
					                                    			for($i=0; $i< $v->level-1; $i++){
					                                    				echo "&nbsp&nbsp&nbsp&nbsp";
					                                    			}
					                                    			if($v->level>0) {echo '&nbsp&nbsp &#8970;__ ';
					                                    				echo "<span style='font-weight: normal;color: green;'>$v->name</span>";
										    						}else{
										    							echo $v->name;
										    						}
										    						?>
					                                    		</a>
					                                    		<div class="action" id="neocat-<?php echo $v->id;?>">
												                    <img src="<?php echo base_url();?>public/admin/img/edit.gif" /><a href="<?php echo admin_url(); ?>/edit-menu/<?php echo $v->id;?>"><?php echo $this->lang->line('edit'); ?></a>
												                    <?php if($total_amount > 1){?>
												                    	| <img src="<?php echo base_url();?>public/admin/img/delete.gif" /><a href="#" onclick="Remove('<?php echo admin_url();?>/delete-menu/<?php echo $v->id;?>', '<?php echo $v->name;?>')" class="Delete"><font color="#be0000"><?php echo $this->lang->line('delete'); ?></font></a>
												                    <?php }?>
												                </div>
					                                    	</div>
					                                    </td>
					                                    <td align="left"><?php echo $v->url;?></td>
					                                    <td align="left"><span style="color: #0066FF; "><?php if($v->parent_name == ""){echo " ----- ";}else {echo $v->parent_name;}?></span></td>
					                                    <td align="left">
					                                      <input type="text" name="order" class="order" id="<?php echo $v->id;?>"  value="<?php echo $v->order;?>" maxlength="3" style="width:25px; float:left;" />
				                                        </td>
				                                        <td align="left">
				                                        	<?php if($v->active == 'yes'){?>
																<?php if($check_is_child == false){?>											            	
												            		<a href="javascript:void(0);" onclick="__status('<?php echo $v->id; ?>', 'no', 'menu/change-status/', '<?php echo $current_url;?>')"><img src="<?php echo base_url();?>public/admin/img/active.png" title="<?php echo $this->lang->line('active'); ?>" alt="Yes" class="icon png" /></a>
												            	<?php }else{?>
												            		<img src="<?php echo base_url();?>public/admin/img/active.png" title="<?php echo $this->lang->line('active'); ?>" alt="Yes" class="icon png" />
												            	<?php }?>
												            <?php }else{?>
												            	<?php if($check_is_child == false){?>	
												            		<a href="javascript:void(0);" onclick="__status('<?php echo $v->id; ?>', 'yes', 'menu/change-status/', '<?php echo $current_url;?>')"><img src="<?php echo base_url();?>public/admin/img/pending.png" title="<?php echo $this->lang->line('suspend'); ?>" alt="No" class="icon png" /></a>
												            	<?php }else{?>
												            		<img src="<?php echo base_url();?>public/admin/img/pending.png" title="<?php echo $this->lang->line('suspend'); ?>" alt="No" class="icon png" />
												            	<?php }?>
												            <?php }?>
				                                        </td>
				                                  	</tr>
													<?php }?>
												        <?php } else {?>
												        	<p style="padding: 10px;font-size: 16px; font-style: italic; color: green;" >There are no results match !</p>
												        <?php }?>
											  </table>
				         
											  </div>
											  <span class="right1">
											  		<!-- 
									                <div class="pagination">
									                	<?php if(isset($pagination)){echo $pagination;}?>
									            	</div>
									            	 -->
								              </span>
			                              </form>
			                              </div>
			                          </div><!--tab2-->
			                  	  </div>
		                  	  </div><!--/END TAB/-->
		                  <div class="clear"/></div>  
		                  </div>
	                  </div>
                  <div class="clear"></div>
                  <script type="text/javascript">
                  
						$('.order').keydown(function(event){
				        	if ( event.keyCode == 46 || event.keyCode == 8 ) {
				                // let it happen, don't do anything
				            }else{
				                // Ensure that it is a number and stop the keypress
				                if ((event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105 )) {
				                    event.preventDefault(); 
				                }   
				            }
							
				            if(event.keyCode == 13) { // Enter pressed
						        var menu_order = $(this).val();
					            var menu_id = $(this).attr('id');
					            $('input[name="menu_id"]').val(menu_id);
					            $('input[name="menu_order"]').val(menu_order);
					            $('#change_order_menu').submit();
				        	}
				        });
					
                  </script>
                  <script type="text/javascript" src="<?php echo base_url();?>public/admin/js/login.js"></script>
                  <script type="text/javascript">
                  	var do_action_success 		= '<?php echo $this->session->userdata('menu_do_action_success');?>';
                	var do_action_mess			= '<?php echo $this->lang->line('action_mess');?>';
                	if(do_action_success == "yes"){$('#tonySuccess').addClass('success').html(do_action_mess).stop(true,true).show().animate({ opacity: 1,right: '10'}, 1000);setTimeout('hideTop()',3500);<?php $this->session->unset_userdata('menu_do_action_success');?>}

					var change_status_success 	= '<?php echo $this->session->userdata('menu_change_status_success');?>';
                	var change_status_mess		= 'Status has been changed successfully !';
					if(change_status_success == "yes"){$('#alertMessage').addClass('success').html(change_status_mess).stop(true,true).show().animate({ opacity: 1,right: '10'}, 1000);setTimeout('hideTop()',3500);<?php $this->session->unset_userdata('menu_change_status_success');?>}

					var change_order_success 	= '<?php echo $this->session->userdata('menu_change_order_success');?>';
                	var change_order_mess		= 'Order has been changed successfully !';
					if(change_order_success == "yes"){$('#alertMessage').addClass('success').html(change_order_mess).stop(true,true).show().animate({ opacity: 1,right: '10'}, 1000);setTimeout('hideTop()',3500);<?php $this->session->unset_userdata('menu_change_order_success');?>}

					function changeItemNumber() {
						$("#list_menu_form").submit();
					}
				
					function sendData(sta){
					    var status = sta;
					    $('input[name="status"]').val(status);
					    $('#show_type').submit();
					}
				

					function submit_action(){
						submitVal = $('#action').val();
					     $('#menu_form').append("<input type='hidden' name='action' value='"+submitVal+"' />");
					     $('#menu_form').submit();
					     return true;
					}
					
					
					
					function Remove(url, name){
						$(".Delete").live('click',function() {
							  var row=$(this).parents('tr');
							  var dataSet=$(this).parents('form');
							  var id = $(this).attr("id");
							  var data ='id='+id;
							  DeleteT(data,name,row,0,dataSet, url);
						});
					}

					function DeleteT(data,name,row,type,dataSet, url){
						var loadpage = dataSet.hdata(0);
						
						var table = dataSet.hdata(2);
						var data = data+"&tabel="+table;
						$.confirm({
						'title': '_DELETE DIALOG BOX','message': " <strong><?php echo $this->lang->line('delete_conf') ?></strong><br /><font color=red>' "+ name +" ' </font> ",'buttons': {'Yes': {'class': 'special',
						'action': function(){
							loading('Checking');
											 $('#preloader').html('Deleting...');
											 if(type==0){ row.slideUp(function(){   showSuccessTony('Delete Successfully',1000); unloading(); }); $.post(url);setTimeout("hideTop();",2000);return true;}
											 if(type==1){ row.slideUp(function(){   showSuccess('Success',2000); unloading(); }); return true;}
												//setTimeout("unloading();",900);
												setTimeout("hideTop();",1000); 		 
								 }},'No'	: {'class'	: ''}}});}
				</script>
				<?php
				    echo form_open(admin_url('menu/change-order'), array('id' => 'change_order_menu'), array('menu_id' => 0, 'menu_order' => 0));
				    echo form_close();
				?>
				<?php
				    echo form_open(admin_url('menu'), array('id' => 'show_type'), array('status' => 0));
				    echo form_close();
				?>